package cn.howxu.yichen_ovo.datagen;

import cn.howxu.yichen_ovo.Res;
import cn.howxu.yichen_ovo.YiChenOVO;
import cn.howxu.yichen_ovo.init.ModItems;
import net.minecraft.advancements.Advancement;
import net.minecraft.advancements.AdvancementRewards;
import net.minecraft.advancements.FrameType;
import net.minecraft.advancements.RequirementsStrategy;
import net.minecraft.core.HolderLookup;
import net.minecraft.data.advancements.AdvancementSubProvider;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.MutableComponent;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.ItemLike;
import net.minecraftforge.common.data.ExistingFileHelper;
import net.minecraftforge.common.data.ForgeAdvancementProvider;

import java.util.function.Consumer;

/**
 * @description: TODO
 * @author: HowXu
 * @date: 2025/10/3 20:17
 */
public class AdvanGenerator implements ForgeAdvancementProvider.AdvancementGenerator {
    
    public static Advancement BUDAI;
    
    @Override
    public void generate(HolderLookup.Provider provider, Consumer<Advancement> consumer, ExistingFileHelper existingFileHelper) {
        // 不呆成就
        BUDAI = Advancement.Builder.advancement()
                .display(
                        ModItems.ATMStar.get(), // 图标
                        Component.literal("title.yichenovo.budai"), // 标题
                        Component.literal("title.yichenovo.budai.desc"), // 描述
                        Res.rl("textures/environment/sky"),
                        FrameType.CHALLENGE,
                        true, // 显示Toast
                        true, // 公告到聊天
                        false // 是否隐藏
                )
                .requirements(RequirementsStrategy.OR)
                .save(consumer,Res.rl("budai").toString());
        
    }
}
